﻿angular.module('resources.collectorSignatureProxy', []);
angular.module('resources.collectorSignatureProxy').factory('collectorSignatureProxy', ['rresource', '$http', 'APPSETTING', function (rresource, $http, APPSETTING) {
    var factory = rresource('collectorSignature');

    factory.getCollectortSign = function (signature, successcb, failedcb) {
        return factory.queryObject({ 'sign': signature }, successcb, failedcb);
    }

    factory.addOrUpdateCollect = function (signature, successcb, failedcb) {
        $http({
            url: APPSETTING['serverUrl'] + '/api/collectorSignature' ,
            method: 'POST',
            data: signature
        }).success(function (response) {
            successcb(response);
        }).error(function (ex) {
            failedcb(ex);
        });
    }


    return factory;
}]);
